import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: mirac
 * Date: 2025-04-21
 * Time: 23:14
 */
public class Maop_sort {
    public static void sort(int[] arr) {
        for(int i = 0; i < arr.length - 1 ; i++) {
            for(int j = 0; j < arr.length - 1 - i; j++) {
                int tem = 0;
                if(arr[j] > arr[j + 1]) {
                    tem = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = tem;
                }
            }
        }
    }
    public static void main(String[] args) {
        int[] arr = {2,1,4,7,3,5,9,8};
        sort(arr);
        System.out.println(Arrays.toString(arr));
    }
}
